<template>
  <div class="header_hot">
    <div class="hot_name">
      <!-- <span class="line"></span> -->
      <!-- <h2 class="hot_posts"> 退役军人、军人家属招聘专区</h2> -->
      <!-- <h2 class="hot_posts"> 热门公司</h2> -->
      <!-- <span class="line"></span> -->
      <div>
        <img src="@/assets/img/zs-10.png" alt="">
      </div>
      <el-divider class="divider"></el-divider>
    </div>

    <el-row>
      <el-col :span="6" v-for="(item, index) in companyList" :key="index">
        <div class="grid-content bg-purple-light" @click="handleclick(item)" style="cursor: pointer;">
          <div class="logoImg">
            <img :src="(item.logo || require('../../../assets/img/qiye.png'))" alt="">
          </div>
          <h3 class="campanyName">{{item.name}}</h3>
          <div class="rzzw"><span class="num">{{item.hotJobCount || 0}}</span>个热招职位</div>
        </div>
      </el-col>
    </el-row>
    <div class="seeMore" v-if="true" @click="moreJob">查看更多</div>
  </div>
</template>

<script>
import { selectcompanyformaster } from '../../../api/homeIndex';
export default {
  name: 'hotCompanies',
  data () {
    return {
      companyList: []
    }
  },
  methods: {
    handleclick (item) {
      console.log(item, '准备进企业详情')
      this.$router.push({
        path: '/Popularenterprises',
        query: {
          companyId: item.id
        }
      })
    },
    // 热门公司
    selectcompanyformaster () {
      let obj = {}
      selectcompanyformaster(obj).then((res) => {
        if (res.success) {
          let data = res.data
          // console.log(data, '热门公司')
          this.companyList = data
        } else {
          this.$message.error(res.msg)
        }
      })
    },
    // 查看更多
    moreJob () {
      console.log('789456')
      this.$router.push({
        path: '/JobHunting',
        query: { all: 'all' }

      })
    }
  },
  created () {
    this.selectcompanyformaster()
  }
}
</script>

<style scoped>
.header_hot {
    width: 1200px;
    margin: 0 auto;
}
.hot_name {
    width: 100%;
    height: 55px;
    /* display: flex;
    align-items: center;
    justify-content: center; */
    margin: 0 auto;
}
.hot_name span {
    width: 50px;
    height: 0px;
    border: 1px solid rgba(204, 204, 204, 1);
    opacity: 1;
}
.hot_posts {
    text-align: center;
    margin: 0 30px;
}
/* 公司 */
.grid-content {
    height: 268px;
    width: 286px;
    margin: 5px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #e0e0e0;
}
.logoImg {
    width: 88px;
    height: 88px;
    background: rgba(242, 242, 242, 1);
    opacity: 1;
    border-radius: 6px;
    margin-bottom: 20px;
}
.logoImg img {
    width: 100%;
    height: 100%;
}

.campanyName {
    width: 80%;
    /* margin: 18px 0px 29px 0px; */
    text-align: center;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    border-top: 1px solid #e0e0e0;
    padding: 20px 0px 8px 0px;
}

.rzzw {
    width: 130px;
    height: 40px;
    background: rgba(255, 255, 255, 1);
    /* border: 1px solid rgba(232, 232, 232, 1); */
    /* line-height: 40px; */
    text-align: center;
    font-size: 14px;
    font-family: PingFang SC;
    font-weight: 400;
    color: rgba(85, 85, 85, 1);
    cursor: pointer;
}
.rzzw .num {
    color: #0093ff;
}
.seeMore {
    width: 340px;
    height: 40px;
    margin: 30px auto;
    border: 1px solid rgba(24, 147, 252, 1);
    opacity: 1;
    text-align: center;
    line-height: 40px;
    font-size: 16px;
    font-family: PingFang SC;
    font-weight: 400;
    color: rgba(24, 147, 252, 1);
    cursor: pointer;
}
.divider {
    color: rgba(24, 147, 252, 1);
    background: rgba(24, 147, 252, 1);
}
</style>